<!DOCTYPE html>
<html xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml"
    xmlns:v-model="http://www.w3.org/1999/xhtml" lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Amaze UI Admin index Examples</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="/assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="/assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <script src="/assets/js/echarts.min.js"></script>
    <link rel="stylesheet" href="/assets/css/amazeui.min.css" />
    <link rel="stylesheet" href="/assets/css/amazeui.datatables.min.css" />
    <link rel="stylesheet" href="/assets/css/app.css">
    <link rel="stylesheet" href="/css/default.css">
    <script src="/assets/js/jquery.min.js"></script>
    <script src="/wangEditor-3.1.1/release/wangEditor.min.js"></script>
    <!--图片上传弹窗工具-->
    <link rel="stylesheet" href="/css/cropper.min.css">
    <link rel="stylesheet" href="/css/ImgCropping.css">
    <script src="/js/util/cropper.min.js"></script>
    <script src="/js/util/exif.js"></script>
    <script src="/js/util/imgUtils.js"></script>
    <!--图片上传弹窗工具-->
    <style>
        .am-tabs-nav li {
            position: relative;
            z-index: 1;
        }

        .am-tabs-nav .am-icon-close {
            position: absolute;
            top: 0;
            right: 10px;
            color: #888;
            cursor: pointer;
            z-index: 100;
        }

        .am-tabs-nav .am-icon-close:hover {
            color: #333;
        }

        .am-tabs-nav .am-icon-close~a {
            padding-right: 25px !important;
        }
    </style>
</head>

<body data-type="widgets">
    <script src="/assets/js/theme.js"></script>
    <div class="am-g tpl-g">
        <div id="head">
        </div>
        <div id="menu">
        </div>
        <!-- 风格切换 -->
        <div class="tpl-skiner">
            <div class="tpl-skiner-toggle am-icon-cog">
            </div>
            <div class="tpl-skiner-content">
                <div class="tpl-skiner-content-title">
                    选择主题
                </div>
                <div class="tpl-skiner-content-bar">
                    <span class="skiner-color skiner-white" data-color="theme-white"></span>
                    <span class="skiner-color skiner-black" data-color="theme-black"></span>
                </div>
            </div>
        </div>

        <!-- 内容区域 -->
        <div class="tpl-content-wrapper" id="content">
            <div class="container-fluid am-cf">
                <div class="row">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-9">
                        <div class="page-header-heading"><span class="am-icon-home page-header-heading-icon"></span> 商品
                            <small>新建商品信息</small></div>
                        <!--<p class="page-header-description">Amaze UI 有许多不同的表格可用。</p>-->
                    </div>
                    <!--<div class="am-u-lg-3 tpl-index-settings-button">-->
                    <!--<button type="button" class="page-header-button"><span class="am-icon-paint-brush"></span> 设置</button>-->
                    <!--</div>-->
                </div>

            </div>

            <div class="row-content am-cf">
                <div class="row">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">基本信息</div>
                                <div class="widget-function am-fr">
                                    <a href="javascript:;" class="am-icon-cog">保存</a>
                                </div>
                            </div>
                            <div class="widget-body am-fr">
                                <form class="am-form tpl-form-line-form">
                                    <div class="am-form-group" v-bind:style="{display:isDisplay}">
                                        <label for="itemId" class="am-u-sm-3 am-form-label">商品Id <span
                                                class="tpl-form-line-small-title">：</span></label>
                                        <div class="am-u-sm-9">
                                            <input type="text" class="tpl-form-input" id="itemName" readonly="readonly"
                                                v-model="itemId">
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label for="itemName" class="am-u-sm-3 am-form-label">商品名称 <span
                                                class="tpl-form-line-small-title">：</span></label>
                                        <div class="am-u-sm-9">
                                            <input type="text" v-model="item.itemName" class="tpl-form-input"
                                                id="itemName" placeholder="请输入标题文字" v-bind:disabled="disabled">
                                            <small>商品名称为必填</small>
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label for="category" class="am-u-sm-3 am-form-label">选择分类 <span
                                                class="tpl-form-line-small-title">：</span></label>
                                        <div class="am-u-sm-9">
                                            <select id="category" v-bind:disabled="disabled" v-model="item.category">
                                                <template v-for="(ctg, index) in categorys">
                                                    <option style="display: block;background: rgb(173, 170, 170)"
                                                        v-bind:value="ctg.ctgId">{{ctg.ctgName}}</option>
                                                </template>
                                            </select>
                                            <small>商品分类必选</small>
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label class="am-u-sm-3 am-form-label">支付方式 <span
                                                class="tpl-form-line-small-title">：</span></label>
                                        <div class="am-u-sm-9">
                                            <label class="am-checkbox-inline">
                                                <input type="checkbox" name="payTypes" v-model="item.payTypes"
                                                    value="2"> 在线支付
                                            </label>
                                            <label class="am-checkbox-inline">
                                                <input type="checkbox" name="payTypes" v-model="item.payTypes"
                                                    value="1"> 线下支付
                                            </label>
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label class="am-u-sm-3 am-form-label">交易方式 <span
                                                class="tpl-form-line-small-title">：</span></label>
                                        <div class="am-u-sm-9">
                                            <label class="am-checkbox-inline">
                                                <input type="checkbox" name="transportTypes" id="zt"
                                                    v-model="item.transportTypes" value="1"> 当面交易
                                            </label>
                                            <label class="am-checkbox-inline">
                                                <input type="checkbox" name="transportTypes" id="mj"
                                                    v-model="item.transportTypes" value="2"> 上门自提
                                            </label>
                                            <label class="am-checkbox-inline">
                                                <input type="checkbox" name="transportTypes" id="mail"
                                                    v-model="item.transportTypes" value="3"> 邮寄
                                            </label>
                                            <span v-for="(type, index) in item.transportTypes" :key="index">
                                                <label v-if="type==3" class="am-checkbox-inline">
                                                    <input type="text" value="" v-model="item.postage"
                                                        placeholder="￥邮费">
                                                </label>
                                            </span>

                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label class="am-u-sm-3 am-form-label">售卖价格 <span
                                                class="tpl-form-line-small-title">：</span></label>
                                        <div class="am-u-sm-9">
                                            <div class="am-input-group">
                                                <span class="am-input-group-label">￥</span>
                                                <input type="text" v-bind:disabled="disabled"
                                                    v-model="item.sellingPrice" class="am-form-field">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label class="am-u-sm-3 am-form-label">购买价格 <span
                                                class="tpl-form-line-small-title">：</span></label>
                                        <div class="am-u-sm-9">
                                            <div class="am-input-group">
                                                <span class="am-input-group-label">￥</span>
                                                <input type="text" v-bind:disabled="disabled" v-model="item.buyPrice"
                                                    class="am-form-field">

                                            </div>
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label class="am-u-sm-3 am-form-label">商品成色 <span
                                                class="tpl-form-line-small-title">：</span></label>
                                        <div class="am-u-sm-9">
                                            <label class="am-radio-inline">
                                                <input type="radio" name="new" placeholder="商品大概几成新"
                                                    v-model="item.itemNew" value="1" v-bind:disabled="disabled">全新
                                            </label>
                                            <label class="am-radio-inline">
                                                <input type="radio" name="new" placeholder="商品大概几成新"
                                                    v-model="item.itemNew" value="2" v-bind:disabled="disabled">九成新
                                            </label>
                                            <label class="am-radio-inline">
                                                <input type="radio" name="new" placeholder="商品大概几成新"
                                                    v-model="item.itemNew" value="3" v-bind:disabled="disabled">八成新
                                            </label>
                                            <label class="am-radio-inline">
                                                <input type="radio" name="new" placeholder="商品大概几成新"
                                                    v-model="item.itemNew" value="4" v-bind:disabled="disabled">六至七成新
                                            </label>
                                            <label class="am-radio-inline">
                                                <input type="radio" name="new" placeholder="商品大概几成新"
                                                    v-model="item.itemNew" value="5" v-bind:disabled="disabled">五成新及以下
                                            </label>
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label class="am-u-sm-3 am-form-label">SEO关键字 <span
                                                class="tpl-form-line-small-title">：</span></label>
                                        <div class="am-u-sm-9">
                                            <input type="text" placeholder="设置查询关键词方便买家搜索到(品类品牌型号等关键词)"
                                                v-model="item.seoWord" v-bind:disabled="disabled">
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <div class="am-u-sm-9 am-u-sm-push-3">
                                            <button type="button" class="am-btn am-btn-primary tpl-btn-bg-color-success"
                                                v-on:click="saveItemBase()">保存</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">详细信息</div>
                                <div class="widget-function am-fr">
                                    <a href="javascript:;" class="am-icon-cog"></a>
                                </div>
                            </div>
                            <div class="widget-body am-fr">

                                <form class="am-form tpl-form-line-form">
                                    <div class="am-form-group">
                                        <label class="am-u-sm-3 am-form-label">商品描述 <span
                                                class="tpl-form-line-small-title">：</span></label>
                                        <div class="am-u-sm-9">
                                            <textarea class="" v-model="details.reason" rows="5"
                                                id="doc-ta-1"></textarea>
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label class="am-u-sm-3 am-form-label">规格属性 <span
                                                class="tpl-form-line-small-title">：</span></label>
                                        <br />
                                        <div class="am-u-sm-9">
                                            <table class="am-table am-table-bordered">
                                                <tr>
                                                    <td>属性名</td>
                                                    <td>属性值</td>
                                                    <td>操作</td>
                                                </tr>
                                                <tr v-for="(guige,index) in details.sepc">
                                                    <td><input type="text" v-model="guige.name" /></td>
                                                    <td><input type="text" v-model="guige.value" /></td>
                                                    <td><button type="button" class="am-btn am-btn-danger"
                                                            v-on:click="deleteGuige(index)">删除</button></td>
                                                </tr>
                                            </table>
                                            <button type="button" class="am-btn am-btn-secondary"
                                                v-on:click="addGuige()">添加属性</button>
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label class="am-u-sm-3 am-form-label">商品数量<span
                                                class="tpl-form-line-small-title">：</span></label>
                                        <div class="am-u-sm-9">
                                            <input type="text" class="tpl-form-input" v-model="details.stock"
                                                v-bind:disabled="disabled" value="">
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label class="am-u-sm-3 am-form-label">上传图片 <span
                                                class="tpl-form-line-small-title">：</span></label>
                                        <div class="am-u-sm-9">
                                            <div class="am-form-group am-form-file">
                                                <button type="button" class="am-btn am-btn-danger am-btn-sm"
                                                    id="replaceImg" onclick="imgClick()">
                                                    <i class="am-icon-cloud-upload"></i> 添加封面图片</button>
                                                <!-- <input id="doc-form-file"  v-bind:disabled="disabled" type="file" multiple=""> -->
                                                <div class="tpl-form-file-img">
                                                    <ul>
                                                        <li style="float:left" v-for="(item, index) in details.imgs"
                                                            :key="index">
                                                            <img width="200px" v-bind:src="item.src" alt=""></li>
                                                    </ul>
                                                </div>
                                                <br />

                                            </div>

                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label class="am-u-sm-3 am-form-label">商品介绍 <span
                                                class="tpl-form-line-small-title">:</span></label>
                                        <div class="am-u-sm-9">
                                            <div class="editor">

                                            </div>
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <div class="am-u-sm-9 am-u-sm-push-3">
                                            <button type="button" class="am-btn am-btn-primary tpl-btn-bg-color-success"
                                                v-on:click="saveItemDetails()">发布</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </div>
    <!--消息弹窗 begin-->
    <div class="am-modal am-modal-no-btn" tabindex="-1" id="your-modal">
        <div class="am-modal-dialog">
            <div class="am-modal-hd">温馨提示
                <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
            </div>
            <div class="am-modal-bd">
                最多只能添加20条属性值
            </div>
        </div>
    </div>
    <!--消息弹窗 end-->

    <!--图片裁剪弹窗 begin-->
    <div style="display: none;z-index: 999999" class="tailoring-container">
        <div class="black-cloth" onclick="closeTailor(this)"></div>
        <div class="tailoring-content">
            <div class="tailoring-content-one">
                <label title="上传图片" for="chooseImg" class="l-btn choose-btn">
                    <input type="file" style="display:none" accept="image/jpg,image/jpeg,image/png" name="file"
                        id="chooseImg" class="hidden" onchange="selectImg(this)">
                    选择图片
                </label>
                <div class="close-tailoring" onclick="closeTailor(this)">×</div>
            </div>
            <div class="tailoring-content-two">
                <div class="tailoring-box-parcel">
                    <img id="tailoringImg">
                </div>
                <div class="preview-box-parcel">
                    <p>图片预览：</p>
                    <div class="square previewImg"></div>
                    <adiv class="circular previewImg"></adiv>
                </div>
            </div>
            <div class="tailoring-content-three">
                <button class="l-btn cropper-reset-btn">复位</button>
                <button class="l-btn cropper-rotate-btn">旋转</button>
                <button class="l-btn cropper-scaleX-btn">换向</button>
                <button class="l-btn sureCut" id="sureCut">确定</button>
            </div>
        </div>
    </div>
    <!--图片裁剪弹窗 end-->
    <script src="/assets/js/amazeui.min.js"></script>
    <script src="/assets/js/amazeui.datatables.min.js"></script>
    <script src="/assets/js/dataTables.responsive.min.js"></script>
    <script src="/assets/js/handlebars.min.js"></script>
    <script src="/assets/js/amazeui.widgets.helper.js"></script>
    <script src="/assets/js/app.js"></script>
    <script src="/js/jquery.cookie.js"></script>
    <script type="text/javascript" src="/layui/layui.js"></script>
    <script src="/js/vue.js"></script>
    <script src="/js/axios.min.js"></script>
    <script src="/js/common.js"></script>
    <script src="/item/js/itemEdit.js"></script>

</body>

</html>